#include <QSettings>
#include <QTemporaryFile>
#include <QTextStream>
+// #include <QDebug>
#include "mainwindow.h"
#include "../gbversion.h"
QString str;
for (int i = 0; i< options.size(); i++) {
FormatOption option = options[i];
+ QVariant default_value = option.getDefaultValue();
if (option.getSelected()) {
// For OPTbool, 'selected' is the key, not value.
if (option.getType() == FormatOption::OPTbool) {
// Only write "foo=1" if that's not already the default.
- if (option.getDefaultValue() != "1") {
+ if (default_value != "1") {
str += "," + option.getName() + "=1";
}
} else {
// turn it off here, but only if the default isn't zero
// or given.
if (option.getType() == FormatOption::OPTbool &&
- option.getDefaultValue() != "0" &&
- option.getDefaultValue() != "") {
+ default_value != "0" &&
+ default_value != "") {
str += "," + option.getName() + "=0";
}
}
break;
case FormatOption::OPTbool:
- // This is quirky. It means that GPSBabel's bool options that default
- // to true get turned on here, even if user turned them off on last
- // exit.
- checkBox->setChecked(getOptionValue(options_,k).toBool());
+ // If it was selected before, select it again.
+ checkBox->setChecked(options_[k].getSelected());
w = 0;
break;